import request from "@/utils/request";

const COMMON_BASE_URL = '/lipu/flow/common';

const CommonAPI = {
    /**
     * 获取样品类别
     *
     * @returns 样品类别
     */
    getSampleCategory() {
        return request<any>({
            url: `${COMMON_BASE_URL}/category`,
            method: "get",
            // params: queryParams,
        });
    },

    /**
     * 获取检测参数
     *
     * @param queryParams category_id
     * @returns 样品类别
     */
    getDetectionParameters(queryParams: CategoryId) {
        return request<any>({
            url: `${COMMON_BASE_URL}/test_params`,
            method: "get",
            params: queryParams,
        });
    },

    /**
     * 获取检测方法
     *
     * @param queryParams category_id
     * @returns 样品类别
     */
    getDetectionMethod(queryParams: ParmsId) {
        return request<any>({
            url: `${COMMON_BASE_URL}/test_method`,
            method: "get",
            params: queryParams,
        });
    },
    /**
     * 获取分析单仪器
     *
     * @param queryParams category_id
     * @returns 样品类别
     */
    getdevice(queryParams: ParmsId) {
        return request<any>({
            url: `${COMMON_BASE_URL}/device`,
            method: "get",
            params: queryParams,
        });
    },
    /**
     * 获取首页表格
     *
     * @param queryParams category_id
     * @returns 样品类别
     */
    getDoc(queryParams: ParmsId) {
        return request<any>({
            url: `${COMMON_BASE_URL}/doc `,
            method: "get",
            params: queryParams,
        });
    },
}
export default CommonAPI;


/**
 * 检测参数
 */
export interface CategoryId {
    /**
     * 任务id
     */
    category_id?: string;
}

/**
 * 检测方法参数
 */
export interface ParmsId {
    /**
     * 任务id
     */
    test_parms_id?: number;
}

